package com.bwie.car.feign.factory;


import com.bwie.car.feign.UserFeign;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author：杨鹏
 * @Package：com.bwie.auth.feign.factory
 * @Project：yp_zhoukao723
 * @name：UserFeignFactory
 * @Date：2024/7/23 9:29
 */
@Component
public class UserFeignFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable cause) {
        return new UserFeign() {
            @Override
            public Result<User> updUser(User user) {
                return Result.error(cause.getMessage());
            }
        };
    }
}
